/*
 * Copyright (c) xxxx-xxxx, Huan
 * SPDX-License-Identifier: Apache-2.0
 *
 * bilibili UID:179895513
 *
 * Date           Author       Notes
 * 2023-04-30     Huan       the first version
 */
#include "g_io_manage.h"
#include "dcmi_drv.h"
#include "ov5640_drv.h"
#include "user_test.h"
#include "uart_dma.h"

Test_HandleTypedef Test_Handle;

void send_jpg(void)
{
    if(Test_Handle.state == sample_OK)
    {
        rt_kprintf("<<<<<<<<<<<<<<<<<<<<<<\r\n\r\n");
        rt_kprintf("sample_OK jpg_size:%ld\r\n", Test_Handle.jpg_size);

        USER_UART2.send((char*)Test_Handle.jpg_buffer, Test_Handle.jpg_size*4);

        rt_kprintf(">>>>>>>>>>>>>>>>>>>>>>\r\n\r\n");
    }
    Test_Handle.state = none;
}

int camera_test(void)
{
    Test_Handle.start_jpg();
    while(Test_Handle.state != sample_OK)
    {
        rt_thread_mdelay(30);
    }
    send_jpg();
    return 0;
}




#include "rtdef.h"
MSH_CMD_EXPORT(camera_test, start a jpg picture);
